package com.zeng.incast.videoplay.live;

import com.zeng.incast.videoplay.hardcode.VideoWrapper;

public class camera {
    static {
        System.loadLibrary("camera");
    }

    static private String TAG = "camera";

    public camera() {

    }

    public void recvEvent(byte[] data, int dataSize, int timeStamp, int channelIdex) {
        VideoWrapper.getInstance().getAvcDecode().decodeList.add(data);
    }

    public boolean init(String url, String user, String passwd, int channelIndex) {
        _jmedia = cameraInit(url, user, passwd, channelIndex);
        if(_jmedia > 0) {
            return true;
        } else {
            return  false;
        }
    }

    public void exit() {
        cameraExit(_jmedia);
    }


    private native long cameraInit(String url, String user, String passwd, int channelIndex);
    private native int cameraExit(long jobj);

    private long _jmedia;
}
